//
// Created by liushuai on 2020/6/3.
//

#include "MyCircularQueue.h"
MyCircularQueue::MyCircularQueue(int k) {
    queue_size = k;
    q = std::vector<int>();
}
bool MyCircularQueue::isEmpty() {
    if(queue_size==0)
        return true;
    else
        return false;
}
bool MyCircularQueue::isFull() {
    if(queue_size == q.size() )
        return true;
    else
        return false;
}
bool MyCircularQueue::enQueue(int value) {
    if(!isFull()){
        q.push_back(value);
        return true;
    }else
        return false;
}
bool MyCircularQueue::deQueue() {
    if(!isEmpty()){
        q.pop_back();
        return true;
    }else
        return false;
}
int MyCircularQueue::Front() {
    if(!isEmpty()){
        return q.front();
    }else
        return -1;
}
int MyCircularQueue::Rear() {
    if(!isEmpty())
        return q.back();
    else
        return -1;
}